/*Author Dave LenzCreation date: 15 apr 2009*/package nl.ypmits.utils.as3.data.basic {	public class DataContainer {		private static var _instance : DataContainer;				private var data : Array = [];				public function dataLength() : int {			return data.length;		}				public static function get instance() : DataContainer {			if( _instance == null ) {				_instance = new DataContainer( );			}			return _instance;		}				public function addItem( d : Array ) : void {			for (var i : int = 0; i < data.length ; i++) {				if(data[i][1] == d[1]) {					throw new Error("ERROR! id:"+d[1]+" already exists! Choose another id!");					break;				}			}			data.push( d );		}						public function getDataById(id : *) : * {			for (var i : int = 0; i < data.length ; i++) {				if(data[i][1] == id) {					return data[i][0];				}			}			return null;		}	}}